using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace InvestmentIntelligence.DbModel.Models.Mapping
{
    public class SuspiciousExposureMap : EntityTypeConfiguration<SuspiciousExposure>
    {
        public SuspiciousExposureMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            // Properties
            // Table & Column Mappings
            this.ToTable("SuspiciousExposure", "DataConsistency");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.FundBookEntityId).HasColumnName("FundBookEntityId");
            this.Property(t => t.SecurityId).HasColumnName("SecurityId");
            this.Property(t => t.Date).HasColumnName("Date");
            this.Property(t => t.SuggestedExposure).HasColumnName("SuggestedExposure");
            this.Property(t => t.DifferencePercent).HasColumnName("DifferencePercent");
            this.Property(t => t.ProcessingTimestamp).HasColumnName("ProcessingTimestamp");

            // Relationships
            this.HasRequired(t => t.FundBookEntity);
            this.HasRequired(t => t.Security);

        }
    }
}
